﻿<EpiDashboard:GadgetBase x:Class="EpiDashboard.ComplexSampleFrequencyControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:EpiDashboard="clr-namespace:EpiDashboard"
    xmlns:Controls="clr-namespace:EpiDashboard.Controls"
    Style="{DynamicResource gadgetBaseStyle}">    
    <EpiDashboard:GadgetBase.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="..\..\ResourceDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </EpiDashboard:GadgetBase.Resources>
    <Grid>
        <Controls:ShadowRectangle x:Name="rectangleShadow"></Controls:ShadowRectangle>
        <Border Name="borderAll" Style="{DynamicResource mainGadgetBorder}" >
            <Border.ContextMenu>
                <ContextMenu x:Name="gadgetContextMenu">
                    <MenuItem x:Name="mnuCopy" Header="Copy data to clipboard"/>
                    <MenuItem x:Name="mnuSendDataToHTML" Header="Send data to web browser">
                        <MenuItem.Icon>
                            <Image Source="../../Images/saveHTML.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem x:Name="mnuSendDataToExcel" Header="Send data to Excel" />
                    <Separator/>
                    <MenuItem x:Name="mnuSendToBack" Header="Send gadget to back"/>
                    <!--<MenuItem x:Name="mnuRefresh" Header="Refresh this gadget">
                        <MenuItem.Icon>
                            <Image Source="../../Images/refresh1.png" />
                        </MenuItem.Icon>
                    </MenuItem>-->
                    <MenuItem x:Name="mnuClose" Header="Close this gadget"/>
                </ContextMenu>
            </Border.ContextMenu>

            <Grid x:Name="grdMain">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="6" />
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="6" />
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="6" />
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="*"></RowDefinition>
                </Grid.RowDefinitions>
                <Controls:GadgetHeaderPanel x:Name="headerPanel" Grid.Row="0" IsFilterButtonAvailable="False" Text="Complex Sample Frequency" />
                <Controls:GadgetMessagePanel Margin="5" x:Name="messagePanel" Grid.Row="2" Text="" />
                <Controls:GadgetDescriptionPanel Grid.Row="4" PanelMode="Collapsed" x:Name="descriptionPanel"></Controls:GadgetDescriptionPanel>

                <TextBlock Grid.Row="6" x:Name="txtFilterString" Style="{DynamicResource filterStringText}" Visibility="Collapsed" >
                </TextBlock>

                <StackPanel Grid.Row="7" x:Name="panelMain" HorizontalAlignment="Left" VerticalAlignment="Top"></StackPanel>

                <Controls:GadgetWaitPanel x:Name="waitPanel" Visibility="Collapsed" Grid.Row="1" Grid.RowSpan="6" Style="{DynamicResource gadgetWaitPanelStyle}" />

                <!--<StackPanel x:Name="panelMain" HorizontalAlignment="Left" VerticalAlignment="Top">-->
        <!--</StackPanel>-->                
                
                    <StackPanel Grid.Row="1" Grid.RowSpan="7" Margin="00,-15,-10,0"  HorizontalAlignment="Right" VerticalAlignment="Top" >
                    <Grid x:Name="ConfigGrid" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,15,10,0" >
                        <Rectangle Style="{DynamicResource rectangleConfigOuter}" />
                        <Rectangle Style="{DynamicResource rectangleConfigInner}" />

                        <Path x:Name="pathTriangle" 
                              Margin="0,-2,90,0"
                              Data="M 5 0 L 10 10 0 10 Z" Fill="{DynamicResource gadgetBackgroundBrush}" IsHitTestVisible="False" HorizontalAlignment="Right" VerticalAlignment="Top" Height="7" />
                        
                            <StackPanel Orientation="Vertical" Margin="25, 10, 25, 25" HorizontalAlignment="Center" VerticalAlignment="Top" >
                            <TextBlock x:Name="ConfigExpandedTitle" HorizontalAlignment="Center" TextAlignment="Center" Text="Complex Sample Frequency Properties" Margin="5" FontWeight="Bold" />
                            <TextBlock x:Name="tblockMainVariable" HorizontalAlignment="Left" TextAlignment="Center" Text="Frequency of:" Margin="0,5,0,0"  />
                            <ComboBox x:Name="cbxField" HorizontalAlignment="Stretch" SelectedIndex="0" />

                            <TextBlock x:Name="tblockWeightVariable" HorizontalAlignment="Left" TextAlignment="Center" Text="Weight:" Margin="0,5,0,0"  />
                            <ComboBox x:Name="cbxFieldWeight" HorizontalAlignment="Stretch" SelectedIndex="0" />
                    
                            <TextBlock x:Name="tblockStrataVariable" HorizontalAlignment="Left" TextAlignment="Center" Text="Stratify by:" Margin="0,5,0,0"  />
                            <ComboBox x:Name="cbxFieldStrata" HorizontalAlignment="Stretch" SelectedIndex="0" />

                            <TextBlock x:Name="tblockPSUVariable" HorizontalAlignment="Left" TextAlignment="Center" Text="PSU:" Margin="0,5,0,0"  />
                            <ComboBox x:Name="cbxFieldPSU" HorizontalAlignment="Stretch" SelectedIndex="0" />

                            <Button x:Name="btnRun" Content="Run" Margin="0,25,0,0" Click="btnRun_Click" />
                        </StackPanel>

                        
                    </Grid>
        </StackPanel>                
            </Grid>
        </Border>
    </Grid>
</EpiDashboard:GadgetBase>
